package com.rain.shoppingscienceproj.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Author: Rain
 * Create: 2018/9/3 11:32
 */
public class MessageAdapter extends FragmentPagerAdapter {

    private final String[] TITLES = {"未读消息", "已读消息"};
    private ArrayList<Fragment> mFragments;

    public MessageAdapter(FragmentManager fm, ArrayList<Fragment> mFragments) {
        super(fm);
        this.mFragments = mFragments;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return TITLES.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return TITLES[position];
    }
}
